package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "坤坤";
        int age = 25;
        String gender = "男";
        String[] otherInfo = {"偶像练习生", "练习时长两年半", "喜欢唱跳rap篮球"};
        Student ss = new Student(name, age, gender, otherInfo);
        System.out.println(ss);
        FileOutputStream fos = new FileOutputStream("student.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(ss);
        System.out.println("写完了");
        oos.close();

    }
}
